/*
 * Ant Group
 * Copyright (c) 2004-2023 All Rights Reserved.
 */
package com.kinghunt.misp.common.enums;

import lombok.Getter;
import org.apache.commons.lang3.StringUtils;

/**
 * @author jinping
 * @version LogicalEnum.java, v 0.1 2023年11月08日 18:35 jinping
 */
@Getter
public enum LogicalEnum {
    LOGICAL_AND("AND"),
    LOGICAL_OR("OR"),
    ;

    private final String code;

    public static LogicalEnum convert(String code) {
        for (LogicalEnum v : values()) {
            if (StringUtils.equals(v.getCode(), code)) {
                return v;
            }
        }
        return null;
    }

    LogicalEnum(String code) {
        this.code = code;
    }


}